<!DOCTYPE html>
<html lang="zh-CN">


<head>
    <meta name="generator" content="Hexo 3.8.0">
    <meta charset="utf-8">
    <meta name="author" content="占位符, 18379933714@139.com">


    <title>占位符个人博客</title>

    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">


    <meta name="keywords" content="Hexo, theme-bmw">


    <script>
        console.log('\n%c Hexo-theme-bmw v4.0 ' + '%c 🎉 https://github.com/dongyuanxin/theme-bmw 🎉\n' + '\n%c View demo online ' + '%c 🔍 https://godbmw.com/ 🔍  \n', 'color: #fadfa3; background: #030307; padding:3px 0;', '', 'color: #fadfa3; background: #030307; padding:3px 0;', '');
    </script>


    <meta name="description" content="爱冒冒，学编程，写代码，品生活">


    <link rel="icon" href="/images/favicon.ico">
    <link rel="apple-touch-icon" href="/images/touch-icon.png">


    <link href="https://cdn.bootcss.com/fancybox/3.5.2/jquery.fancybox.min.css" rel="stylesheet">
    <link rel="stylesheet" href="/css/base.css">
    <link rel="stylesheet" href="/icon/iconfont.css">
    <link rel="stylesheet" href="/css/github-markdown.css">
    <link rel="stylesheet" href="/css/highlight.css">

    <script src="/js/util.js"></script>
    <script src="/js/valine.min.js"></script>


    <link href="https://cdn.bootcss.com/aplayer/1.10.1/APlayer.min.css" rel="stylesheet">
    <script src="https://cdn.bootcss.com/aplayer/1.10.1/APlayer.min.js" async></script>


    <link href="https://cdn.bootcss.com/social-share.js/1.0.16/css/share.min.css" rel="stylesheet">


    <script src="//cdn.bootcss.com/jquery/3.3.1/jquery.min.js" async></script>


    <script src="//cdn.jsdelivr.net/npm/leancloud-storage@3.11.0/dist/av-min.js"></script>


</head>

<body>


<div id="app">

    <div class="header-wrap">
        <header>
            <div class="site-brand">
                <div class="site-title">
                    <a href="/">PLACEHOLDER</a>
                </div>
            </div>
            <nav class="site-navigation">
                <ul class="nav-menu">

                    <li class="nav-item" data-path="/">

                        <a href="/" target="_self">
                            主页
                        </a>

                    </li>

                    <li class="nav-item" data-path="/archives/">

                        <a href="/archives/" target="_self">
                            归档
                        </a>

                    </li>

                    <li class="nav-item" data-path="/categories/">

                        <a href="/categories/" target="_self">
                            分类
                        </a>

                    </li>

                    <li class="nav-item" data-path="/tags/">

                        <a href="/tags/" target="_self">
                            标签
                        </a>

                    </li>

                    <li class="nav-item" data-path="/friends/">

                        <a href="/friends/" target="_self">
                            友链
                        </a>

                    </li>

                    <li class="nav-item" data-path="/about/">

                        <a href="/about/" target="_self">
                            关于
                        </a>

                    </li>

                    <li class="nav-item" data-path="">

                        <a href="javascript:void(0);" v-else="">抓到我</a>
                        <ul class="nav-menu--dropdown">

                            <li>
                                <a href="https://github.com/zjbshk" target="_blank">
                                    Github
                                </a>
                            </li>

                            <li>
                                <a href="https://www.zhihu.com/people/zhan-jin-bing-49/activities" target="_blank">
                                    知乎
                                </a>
                            </li>

                            <li>
                                <a href="https://www.jianshu.com/u/386d5e5dff90" target="_blank">
                                    简书
                                </a>
                            </li>

                        </ul>

                    </li>

                </ul>
            </nav>
            <i class="iconfont icon-menu"></i>
        </header>
    </div>

    <script>
        let links = document.querySelectorAll('.nav-item');
        for (let link of links) {
            let childrenLink = link.querySelector('ul');
            link.addEventListener('mouseenter', () => {
                if (childrenLink) {
                    childrenLink.className = "nav-menu--dropdown active";
                }
            })
            link.addEventListener('mouseleave', () => {
                if (childrenLink) {
                    childrenLink.className = "nav-menu--dropdown";
                }
            })
        }
        let rootRealPath = getRealPath(window.location.pathname, true);
        for (let link of links) {
            let linkPath = link.getAttribute("data-path");
            if (linkPath && getRealPath(linkPath, true) === rootRealPath) {
                link.className = "nav-item hover";
            }
        }

        let iconMenu = document.querySelector("i.iconfont.icon-menu"),
            iconMenuClicked = false;
        let navDOM = document.querySelector("nav.site-navigation");
        iconMenu.addEventListener("click", () => {
            iconMenuClicked
                ? navDOM.className = "site-navigation active"
                : navDOM.className = "site-navigation";
            iconMenuClicked = !iconMenuClicked;
        })
    </script>


    <div class="container home-index">

        <div class="post">
            <h1 class="article-title">
                <a href="/2019/02/04/Markdown语法入门/">
                    <span>Markdown语法入门</span>
                </a>
            </h1>
            <!-- PC端文章信息 -->
            <div class="article-top-meta pc-view">
      <span>
        发布时间 : 2019-02-04
      </span>
            </div>
            <!-- 移动端文章信息 -->
            <div class="article-top-meta mobile-view">
      <span>
        发布 : 2019-02-04
      </span>

                <span>
        分类 :
          <a href="/categories/标记语言/">
            标记语言
          </a>
        </span>


                <span>
          浏览 : <span class="article-timer" data-identity="Markdown语法入门"></span>
        </span>

            </div>

            <div id="Markdown语法入门" style="margin: 4rem 2px -1rem"></div>
            <script async>
                (function () {
                    let playerTimer = setInterval(function () {
                        if (!window.APlayer) {
                            return
                        }

                        new APlayer({
                            container: document.getElementById('Markdown语法入门'),
                            theme: '#e96900',
                            listFolded: false,
                            audio: [{
                                "name": "Where are you",
                                "artist": "AniFace",
                                "url": "//music.163.com/song/media/outer/url?id=453843751.mp3",
                                "cover": "//p1.music.126.net/AUfXMljLBgB3PBV731IzRg==/109951162857118370.jpg?param=130y130"
                            }, {
                                "name": "END THEME",
                                "artist": "天門",
                                "url": "http://music.163.com/song/media/outer/url?id=528306.mp3",
                                "cover": "//p1.music.126.net/1sw_ptPeI_GNm58VBW1udQ==/2504687488135369.jpg?param=130y130"
                            }]
                        });

                        clearInterval(playerTimer)
                    }, 10);
                })()
            </script>

            <!-- 文章简介 -->
            <div class="article-content">
                <div class="markdown-body article-content--inner" v-html="mdToHtml(psg.summary)">
                    <h3 id="Markdown是什么"><a href="#Markdown是什么" class="headerlink" title="Markdown是什么?"></a>Markdown是什么?
                    </h3>
                    <pre><code>一种轻量级标记语言，主要用于文档写作
标记语言还有HTML，XML等
</code></pre>
                </div>
            </div>
            <div class="article-footer">
                <div class="article-meta pull-left">
                    <!-- 分类pc端可见 -->
                    <span class="pc-view">
          
            <i class="iconfont icon-tag"></i>分类:
            <a href="/categories/标记语言/">
              标记语言
            </a>
          </span>

                    <span>
          
            <i class="iconfont icon-06tags"></i>标签:
            
              <span class="span--tag">
                <a href="/tags/Markdown/">
                  #Markdown
                </a>
              </span>
            
              <span class="span--tag">
                <a href="/tags/入门/">
                  #入门
                </a>
              </span>
            
                    
        </span>
                </div>

                <div class="article-meta pull-right">
          <span class="pc-view">
            <i class="iconfont icon-view"></i>浏览: <span class="article-timer" data-identity="Markdown语法入门"></span>
          </span>
                </div>

            </div>
        </div>


        <nav class="page-navigation">


        </nav>


        <script defer>
            const valineAPI = (() => {
                try {
                    AV.init("58sVdVvYaDvhFpLCEXyUNGov-gzGzoHsz", "v9j9EI1HxxnWIKtqUCCY7jgL");
                } catch (error) {
                }
                const isExist = (identity) => {
                    identity = identity || getRealPath();
                    let query = new AV.Query('Timer');
                    return new Promise((resolve, reject) => {
                        query.equalTo("identity", identity);
                        query.find().then(results => {
                            resolve(results.length > 0);
                        }, error => reject(error));
                    })
                }

                const _get = (identity) => {
                    let query = null;
                    if (identity && identity instanceof Array) {
                        let querys = [];
                        for (let i = 0; i < identity.length; ++i) {
                            querys[i] = new AV.Query('Timer');
                            querys[i].equalTo('identity', identity[i]);
                        }
                        query = AV.Query.or.apply(null, querys);
                    } else {
                        identity = identity || getRealPath();
                        query = new AV.Query("Timer");
                        query.equalTo("identity", identity);
                    }

                    return new Promise((resolve, reject) => {
                        query.find()
                            .then(results => resolve(results))
                            .catch(error => reject(error))
                    })
                }

                const create = (identity) => {
                    identity = identity || getRealPath();
                    return new Promise((resolve, reject) => {
                        let Todo = AV.Object.extend('Timer');
                        let todo = new Todo();
                        todo.set("times", 1);
                        todo.set("identity", identity);
                        todo.save().then(res => resolve(true), error => reject(error));
                    })
                }

                const update = (identity) => {
                    identity = identity || getRealPath();
                    return new Promise((resolve, reject) => {
                        let query = new AV.Query('Timer');
                        query.equalTo("identity", identity);
                        query.find().then(todos => {
                            todos.forEach(todo => {
                                todo.set("times", todo.attributes.times + 1);
                            });
                            return AV.Object.saveAll(todos);
                        }).then(todos => resolve(true), error => reject(error));
                    })
                }

                return {
                    isExist,
                    _get,
                    update,
                    create
                }
            })()

            const calcAndWriteTimes = () => {
                let isPost = false;

                let timerAllDOM = document.querySelectorAll(".article-timer");

                if (isPost) {
                    let identity = timerAllDOM[0].getAttribute("data-identity");
                    valineAPI.isExist(identity)
                        .then(exist => {
                            if (exist) {
                                return valineAPI.update(identity);
                            }
                            return new Promise(resolve => resolve(true));
                        })
                        .then(succuess => valineAPI._get(identity))
                        .then(result => timerAllDOM[0].innerText = result[0].attributes.times)
                        .catch(error => console.log(error.message))
                    return;
                }

                let timerDOMCache = {};

                for (let timerDOM of timerAllDOM) {
                    let identity = timerDOM.getAttribute("data-identity");
                    if (timerDOMCache.hasOwnProperty(identity)) {
                        timerDOMCache[identity].dom.push(timerDOM);
                    } else {
                        timerDOMCache[identity] = {
                            dom: [timerDOM],
                            times: undefined
                        };
                    }
                }

                let identities = Object.keys(timerDOMCache);
                valineAPI._get(identities).then(results => {
                    for (let result of results) {
                        let {identity, times} = result.attributes;
                        timerDOMCache[identity].times = times;
                        timerDOMCache[identity].dom.map(item => item.innerText = times);
                    }
                    for (let identity of identities) {
                        if (timerDOMCache[identity].times) {
                            continue;
                        }
                        timerDOMCache[identity].dom.map(item => item.innerText = 1);
                        valineAPI.create(identity);
                    }
                }).catch(error => console.log(error.message))
            }

            if (true) {
                calcAndWriteTimes();
            }
        </script>

    </div>


    <footer>
        <p class="site-info">
            博客已萌萌哒运行<span id="time-to-now"></span><span class="my-face">(●'◡'●)ﾉ♥</span>
            <br>
            Theme - <a href="https://github.com/dongyuanxin/theme-bmw">BMW</a> | Made With 💗 | Powered by <a
                href="https://godbmw.com/">GodBMW</a>
            <br>
            <a href="http://www.beian.miit.gov.cn/" target="_blank">赣ICP备20000996</a>
        </p>
    </footer>


    <script>
        const timeToNowDOM = document.querySelector("#time-to-now");
        const startTimestamp = new Date(2019, 1, 4).getTime();

        const updateTimeStr = () => {
            let offset = parseInt(
                (new Date().getTime() - startTimestamp) / 1000,
                10
                ),
                day = Math.floor(offset / 86400),
                hour = Math.floor((offset % 86400) / 3600),
                minute = Math.floor(((offset % 86400) % 3600) / 60),
                second = Math.floor(((offset % 86400) % 3600) % 60);
            timeToNowDOM.innerHTML =
                day + "天" + hour + "小时" + minute + "分钟" + second + "秒";
            setTimeout(updateTimeStr, 500);
        }

        setTimeout(updateTimeStr, 500);
    </script>


    <div class="back-to-top hidden">
  <span>
    <i class="iconfont icon-60"></i><span></span>%
  </span>
    </div>

    <script>
        const updateIconToTop = percent => {
            let dom = document.querySelector(".back-to-top span span");
            dom.innerText = percent;
            if (percent < 1) {
                document.querySelector(".back-to-top").className = "back-to-top hidden";
            } else {
                document.querySelector(".back-to-top").className = "back-to-top";
            }
        }

        const handleScoll = () => {
            let isRunning = false;
            return () => {
                if (isRunning) return;
                isRunning = true;
                window.requestAnimationFrame(timestamp => {
                    let scrollTop =
                        document.documentElement.scrollTop || document.body.scrollTop,
                        scrollHeight =
                            document.documentElement.scrollHeight ||
                            document.body.scrollHeight,
                        clientHeight =
                            document.documentElement.clientHeight ||
                            document.body.clientHeight;
                    isRunning = false;
                    if (scrollTop <= 1) {
                        updateIconToTop(0);
                        return;
                    }
                    if (scrollTop + clientHeight >= scrollHeight) {
                        updateIconToTop(100);
                    } else {
                        updateIconToTop(parseInt(
                            100 * scrollTop / (scrollHeight - clientHeight),
                            10
                        ));
                    }
                });
            };
        }

        const backToTop = () => {
            let scrollTop =
                document.documentElement.scrollTop || document.body.scrollTop,
                delay = 10,
                time = 200;
            if (scrollTop <= 20) {
                document.documentElement.scrollTop = 0;
                document.body.scrollTop = 0;
                return;
            }
            let step = Math.ceil(scrollTop * delay / time);
            let timer = setInterval(() => {
                scrollTop =
                    document.documentElement.scrollTop || document.body.scrollTop;
                if (scrollTop - step <= 0) {
                    document.documentElement.scrollTop = 0;
                    document.body.scrollTop = 0;
                    clearInterval(timer);
                } else {
                    document.documentElement.scrollTop = scrollTop - step;
                    document.body.scrollTop = scrollTop - step;
                }
            }, delay);
        }

        document.addEventListener("scroll", handleScoll(), false);

        document.querySelector(".back-to-top").addEventListener("click", backToTop, false);

    </script>

</div>


<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML"
        async></script>
<script>
    (() => {
        const mathjaxConfig = {
            showProcessingMessages: false, //关闭js加载过程信息
            messageStyle: "none", //不显示信息
            jax: ["input/TeX", "output/HTML-CSS"],
            tex2jax: {
                inlineMath: [["$", "$"], ["\\(", "\\)"]], //行内公式选择符
                displayMath: [["$$", "$$"], ["\\[", "\\]"]], //段内公式选择符
                skipTags: ["script", "noscript", "style", "textarea", "pre", "code", "a"] //避开某些标签
            },
            "HTML-CSS": {
                availableFonts: ["STIX", "TeX"], //可选字体
                showMathMenu: false //关闭右击菜单显示
            }
        }

        let mathjaxInterval = setInterval(() => {
            if (!window.MathJax) {
                return;
            }
            window.MathJax.Hub.Config(mathjaxConfig)
            window.MathJax.Hub.Queue(["Typeset", MathJax.Hub, document.getElementById('app')])

            clearInterval(mathjaxInterval)
        }, 10)
    })()
</script>


<script src="https://cdn.bootcss.com/fancybox/3.5.2/jquery.fancybox.min.js" async></script>
<script async>
    let fancyTimer = setInterval(function () {
        if (!window.$) {
            return;
        }
        $(document).ready(function () {
            $(".post img").each(function () {
                if ($(this).parent().get(0).tagName.toLowerCase() === "a") {
                    return;
                }
                // $(this).attr("data-fancybox", "gallery"); // if you add 'data-fancybox', img will display after showed
                var element = document.createElement("a");
                $(element).attr("data-fancybox", "gallery");
                $(element).attr("href", $(this).attr("src"));
                $(this).wrap(element);
            });

            clearInterval(fancyTimer);
        });
    }, 10);
</script>


</body>

</html>
